. as $root | 
  .commits | 
  to_entries | 
  group_by(.value.repo) | 
  map({
    repo: .[0].value.repo, 
    commits: [.[] | .key] | length, 
    cves: ([.[] | .key as $hash | $root.cve_commits | to_entries[] | select(.value[] == $hash) | .key] | unique | length)
  }) | 
  (["| Repository | Commits | CVEs |",
    "| ---------- | ------- | ---- |"] +
   [.[] | "| \(.repo)  | \(.commits)       | \(.cves)    |"]) | 
  .[]
